
pkgname=xfsprogs
pkgver=4.17.0
_pkgver=4.17.0
pkgrel=1
pkgdesc="XFS filesystem utilities"
arch=('x86_64')
license=('LGPL')
url="http://xfs.org/index.php/Main_Page"
groups=('base')
depends=('util-linux')
options=('!makeflags' '!libtool')
source=("https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/${pkgname}-${_pkgver}.tar.xz"
        'sparse_inode.patch')
sha256sums=('f53f5169cb98cfca471ddea30092738c427ba284c5356e01b45dd1ae3b297e0d'
            'eacd18a5c389f87e5d7817873d8ebac219f2179608bed0ade4c0b813d790e72d')

build() {
  cd ${pkgname}-${_pkgver}
  #patch -R -p1 -i ${srcdir}/sparse_inode.patch
  
  export OPTIMIZER="-march=${CARCH/_/-} -O1"
  export DEBUG=-DNDEBUG
  ./configure --prefix=/usr
  make
}

package() {
  cd ${pkgname}-${_pkgver}
  make DIST_ROOT=${pkgdir} install install-dev
  
  chown -R root ${pkgdir}
  chgrp -R root ${pkgdir}
  mv ${pkgdir}/lib/libhandle.so* ${pkgdir}/usr/lib/
  rm -rf ${pkgdir}/lib
}

